﻿using System;
using System.Globalization;
using System.Windows.Data;
using StockholmsStad.Runtime.Serialization.DataContract.Enums;

namespace StockholmsStad.Windows.UI.Infrastructure.Converters
{
    public class CeremonyTypeToBoolConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (targetType != typeof(object))
                throw new InvalidOperationException("The target must be a System.Object");

            if (value != null)
            {
                var ceremonyType = (CeremonyType)value;

                if (ceremonyType == CeremonyType.Ordinary)
                    return true;

                return false;
            }

            return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
